﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;

namespace Maticsoft.Web
{
    public partial class Feedback : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GetSiteInfo();
            GetNav();
        }

        protected void GetNav()
        {
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append("&nbsp; Home > ");
            strBuilder.Append("Feedback");
            nav.InnerHtml = strBuilder.ToString();
        }

        protected void GetSiteInfo()
        {
            BLL.WebSiteConfig bll = new BLL.WebSiteConfig();
            Model.WebSiteConfig model = bll.GetModel(1);
            Title = model.SiteName;
            MetaKeywords = model.KeyWords;
            MetaDescription = model.Description;
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            BLL.FeedBack2 fbBll = new BLL.FeedBack2();
            Model.FeedBack2 fbModel = new Model.FeedBack2();
            fbModel.Title = txtFName.Value.Trim();
            fbModel.Name = txtLName.Value.Trim();
            fbModel.Sex = txtSex.Value.Trim();
            fbModel.Age = txtAge.Value.Trim();
            fbModel.Tel = txtPhone.Value.Trim();
            fbModel.Email = txtEmail.Value.Trim();
            fbModel.Address = txtAddress.Value.Trim();
            fbModel.Company = txtSuburb.Value.Trim();
            fbModel.Postcode = txtPostcode.Value.Trim();
            fbModel.Detail = hidResult.Value.Trim();
            fbModel.CreateTime = DateTime.Now;
            fbModel.UpdateTime = DateTime.Now;
            fbModel.IsActive = 1;
            fbBll.Add(fbModel);
            Response.Redirect("Feedback.aspx");
        }
    }
}